<?php
/* [ system ] */

/*  根目录  */
define('G_APPLICATION_BASEPATH', str_replace(array('core','\\'),array('','/'), __DIR__));

/* 域名 */
if ($_SERVER['SERVER_PORT'] == '80')
	define('G_WEBSITE_DOMAINNAME', 'http://' . $_SERVER['SERVER_NAME']);
else
	define('G_WEBSITE_DOMAINNAME', 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']);

/* js cookie 域名  */
define('G_COOKIE_DOMAIN', $_SERVER['SERVER_NAME']);

/*config根目录  */
$config_root = G_APPLICATION_BASEPATH . 'inc/config/' ;
if (file_exists($config_root . $_SERVER['SERVER_NAME'] . '/'))
	define('G_CONFIG_ROOT', $config_root . $_SERVER['SERVER_NAME'] . '/');
else
	define('G_CONFIG_ROOT', $config_root . 'default/');

/* 是否第三方平台登录（如微信、支付宝） */
define('G_PLATFORM', !isset($_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false ? 0 : 1); 

quanli_require(G_CONFIG_ROOT . 'config.sys.php');
quanli_require(G_CONFIG_ROOT . 'global.php');
quanli_require('inc/lang/' . G_APPLICATION_LANG . '.lang.inc');
